package com.example.speeddating.mapper;

import com.example.speeddating.entity.Photo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *
 * @author tina
 * @since 2023-07-12 02:40:06
 */
@Mapper
public interface PhotoMapper extends BaseMapper<Photo> {

    @Select(value = "select * from photo where user_id = #{userId}")
    public List<Photo> getPhotoByUserId(Long userId);

    @Select(value = "SELECT * FROM  photo  WHERE user_id  = #{userId} LIMIT 1")
    public Photo getFirstPhotoByUserId(Long userId);
}
